﻿{template 'header', $module}
<script type="text/javascript">c(2);var errimg = '{DT_SKIN}image/nopic50.gif';</script>
<div class="menu">
<table cellpadding="0" cellspacing="0">
<tr>
<td class="tab" id="action"><a href="trade.php"><span>Orders received (the seller)</span></a></td>
<td class="tab_nav">&nbsp;</td>
<td class="tab" id="action_order"><a href="trade.php?action=order"><span>Issued orders (buyer)</span></a></td>
{if $DT[trade]}
<td class="tab_nav">&nbsp;</td>
<td class="tab" id="action_bind"><a href="trade.php?action=bind"><span>Binding{$DT[trade_nm]}Account number</span></a></td>
{/if}
</tr>
</table>
</div>
{if $action == 'bind'}
{if $member[vtrade]}
<table cellpadding="10" cellspacing="1" class="tb">
<tr>
<td class="tl">{$DT[trade_nm]}Account number</td>
<td class="tr"><strong>{$member[trade]}</strong></td>
</tr>
<tr>
<td class="tl">Bound state</td>
<td class="tr f_green">Verified</td>
</tr>
<tr>
<td class="tl">{$DT[trade_nm]}</td>
<td class="tr"><a href="{$DT[trade_hm]}" target="_blank" class="l">Transaction Management</a></td>
</tr>
</table>
{else}
<form method="post" action="trade.php">
<input type="hidden" name="action" value="{$action}"/>
<table cellpadding="10" cellspacing="1" class="tb">
<tr>
<td class="tl">{$DT[trade_nm]}网站</td>
<td class="tr">
还没有 <img src="{DT_PATH}api/trade/{$DT[trade]}/logo.gif" alt="{$DT[trade_nm]}" align="absmiddle"/> Member Account? <a href="{$DT[trade_hm]}" target="_blank" class="l">Click to learn and registration</a>
</td>
</tr>
<tr>
<td class="tl">{$DT[trade_nm]}Account number</td>
<td class="tr"><input type="text" size="30" name="trade" id="trade" value="{$member[trade]}"/> <input type="submit" name="submit" value="{if $member[trade]}More new {else} bind{/if}" class="btn"/></td>
</tr>
<tr>
<td class="tl">Bound state</td>
<td class="tr f_red">Unverified</td>
</tr>
<tr>
<td class="tl">Authentication Method</td>
<td class="tr f_gray">By{$DT[trade_nm]}After successful trading system automatically verifies</td>
</tr>
<tr>
<td class="tl">Binding instructions</td>
<td class="tr f_gray">Seller must be bound{$DT[trade_nm]}Account for the receipt, the buyer need not bind</td>
</tr>
</table>
</form>
{/if}
<script type="text/javascript">s('trade');m('action_bind');</script>
{elseif $action == 'update'}
	{if $step == 'edit_price'}
	<form method="post" action="trade.php" onsubmit="return check();" id="dform">
	<input type="hidden" name="forward" value="{$forward}"/>
	<input type="hidden" name="action" value="{$action}"/>
	<input type="hidden" name="step" value="{$step}"/>
	<input type="hidden" name="itemid" value="{$itemid}"/>
	<table cellspacing="1" cellpadding="8" class="tb">
	<tr>
	<td class="tl">Current Operation</td>
	<td class="tr f_red f_b">修改价格</td>
	</tr>
	<tr>
	<td class="tl">Order a single number</td>
	<td class="tr">T{$td[itemid]}</td>
	</tr>
	<tr>
	<td class="tl">Product Name</td>
	<td class="tr"><a href="{$td[linkurl]}" target="_blank" class="t">{$td[title]}</a></td>
	</tr>
	<tr>
	<td class="tl">Product Image</td>
	<td class="tr"><a href="{$td[linkurl]}" target="_blank"><img src="{if $td[thumb]}{$td[thumb]}{else}{DT_SKIN}image/nopic60.gif{/if}" width="60" height="60"/></a></td>
	</tr>
	<tr>
	<td class="tl">Buyers </td>
	<td class="tr">{if $DT[im_web]}{im_web($td[buyer])}&nbsp;{/if}<a href="{userurl($td[buyer], 'file=contact')}" target="_blank" class="t">{$td[buyer]}</a></td>
	</tr>	
	<tr>
	<td class="tl">Expectations Logistics</td>
	<td class="tr">{$td[buyer_receive]}</td>
	</tr>
	<tr>
	<td class="tl">Buyer Remark</td>
	<td class="tr">{$td[note]}</td>
	</tr>
	<tr>
	<td class="tl">Next single time</td>
	<td class="tr">{$td[adddate]}</td>
	</tr>
	<tr>
	<td class="tl">Commodity price</td>
	<td class="tr">￥{$td[price]}</td>
	</tr>
	<tr>
	<td class="tl">Quantity</td>
	<td class="tr">{$td[number]}</td>
	</tr>
	<tr>
	<td class="tl">Order Amount</td>
	<td class="tr f_red">￥{$td[amount]}</td>
	</tr>
	<tr>
	<td class="tl"><span class="f_red">*</span>Additional name</td>
	<td class="tr f_gray"><input type="text" size="10" name="fee_name" id="fee_name" value="{$td[fee_name]}"/> Such as shipping, refunds, concessions&nbsp;<span id="dfee_name" class="f_red"></span></td>
	</tr>
	<tr>
	<td class="tl"><span class="f_red">*</span>Additional amount</td>
	<td class="tr f_gray"><input type="text" size="5" name="fee" id="fee" value="{$td[fee]}"/>  {$DT[money_unit]} Can be negative&nbsp;<span id="dfee" class="f_red"></span></td>
	</tr>
	{if $td[status] < 1}
	<tr>
	<td class="tl"></td>
	<td class="tr"><input type="checkbox" name="confirm_order" value="1"/> While confirming the order</td>
	</tr>
	{/if}
	{if $_userid && $DT[sms]}
	<tr>
	<td class="tl"></td>
	<td class="tr"><input type="checkbox" name="sendsms" value="1"/> SMS notification buyers (<a href="sms.php" target="_blank" class="t">I am available for SMS <strong class="f_blue">{$_sms}</strong> Article</a>)</td>
	</tr>
	{/if}
	<tr>
	<td class="tl"> </td>
	<td class="tr">
	<input type="submit" name="submit" value=" Determined " class="btn"/>&nbsp;&nbsp;<input type="button" value=" Back " class="btn" onclick="history.back(-1);"/>
	</td>
	</tr>
	</table>
	</form>
	<script type="text/javascript">
	function check() {
		if(!Dd('fee_name').value) {
			Dmsg('Please fill in the name of additional amounts', 'fee_name');
			return false;
		}
		if(!Dd('fee').value) {
			Dmsg('Please fill out the additional amount', 'fee');
			return false;
		}
		if(Dd('fee').value < 0 && Dd('fee').value < -{$td[amount]}) {
			Dmsg('Additional amount can not be less than-{$td[amount]}', 'fee');
			return false;
		}
		return true;
	}
	</script>
	<script type="text/javascript">s('trade');m('action');</script>
	{elseif $step == 'detail'}
	<div class="t2">Order details</div>
	<table cellspacing="1" cellpadding="8" class="tb">
	<tr>
	<td class="tl">Order a single number</td>
	<td class="tr">T{$td[itemid]} {if $DT[trade]}({$DT[trade_nm]}Order a single number:<a href="https://lab.alipay.com/consume/queryTradeDetail.htm?tradeNo={$td[trade_no]}" target="_blank" class="t">{$td[trade_no]}</a>){/if}</td>
	</tr>
	<tr>
	<td class="tl">Product Name</td>
	<td class="tr"><a href="{$td[linkurl]}" target="_blank" class="t">{$td[title]}</a></td>
	</tr>
	<tr>
	<td class="tl">Product Image</td>
	<td class="tr"><a href="{$td[linkurl]}" target="_blank"><img src="{if $td[thumb]}{$td[thumb]}{else}{DT_SKIN}image/nopic60.gif{/if}" width="60" height="60"/></a></td>
	</tr>
	{if $td[seller] == $_username}
	<tr>
	<td class="tl">Buyers </td>
	<td class="tr">{if $DT[im_web]}{im_web($td[buyer])}&nbsp;{/if}<a href="{userurl($td[buyer], 'file=contact')}" target="_blank" class="t">{$td[buyer]}</a></td>
	</tr>
	{elseif $td[buyer] == $_username}
	<tr>
	<td class="tl">Seller</td>
	<td class="tr">{if $DT[im_web]}{im_web($td[seller])}&nbsp;{/if}<a href="{userurl($td[seller], 'file=contact')}" target="_blank" class="t">{$td[seller]}</a></td>
	</tr>
	{/if}
	</table>
	<div class="t2">Logistics Information</div>
	<table cellspacing="1" cellpadding="8" class="tb">
	<tr>
	<td class="tl">Zip</td>
	<td class="tr">{$td[buyer_postcode]}</td>
	</tr>
	<tr>
	<td class="tl">Address</td>
	<td class="tr">{$td[buyer_address]}</td>
	</tr>
	<tr>
	<td class="tl">Full name</td>
	<td class="tr">{$td[buyer_name]}</td>
	</tr>
	<tr>
	<td class="tl">Phone</td>
	<td class="tr">{$td[buyer_mobile]} {if $DT[sms]}&nbsp;&nbsp;<a href="sms.php?action=add&auth={encrypt($td[buyer_mobile])}" target="_blank"><img src="{DT_SKIN}image/sendsms.gif" align="absmiddle" title="发送短信" alt=""/></a>{/if}</td>
	</tr>
	<tr>
	<td class="tl">Phone</td>
	<td class="tr">{$td[buyer_phone]}</td>
	</tr>
	<tr>
	<td class="tl">Expectations Logistics</td>
	<td class="tr">{$td[buyer_receive]}</td>
	</tr>
	<tr>
	<td class="tl">Buyer Remark</td>
	<td class="tr">{$td[note]}</td>
	</tr>
	{if $td[send_time]}
	<tr>
	<td class="tl">Logistics Type</td>
	<td class="tr">{$td[send_type]}</td>
	</tr>
	<tr>
	<td class="tl">Logistics number</td>
	<td class="tr">{$td[send_no]}{if $td[send_no]} &nbsp;<a href="{DT_PATH}api/express.php?e={urlencode($td[send_type])}&n={$td[send_no]}" target="_blank" class="t">[Logistics tracking]</a>{/if}</td>
	</tr>
	{/if}
	</table>
	<div class="t2">Price Information</div>
	<table cellspacing="1" cellpadding="8" class="tb">
	<tr>
	<td class="tl">Commodity price</td>
	<td class="tr">￥{$td[price]}</td>
	</tr>
	<tr>
	<td class="tl">Quantity</td>
	<td class="tr">{$td[number]}</td>
	</tr>
	{if $td[fee_name] && $td[fee]}
	<tr>
	<td class="tl">{$td[fee_name]}</td>
	<td class="tr">￥{$td[fee]}</td>
	</tr>
	{/if}
	<tr>
	<td class="tl">Order Total</td>
	<td class="tr f_red">￥{$td[total]}</td>
	</tr>
	</table>
	<div class="t2">Order Status</div>
	<table cellspacing="1" cellpadding="8" class="tb">
	<tr>
	<td class="tl">Next single time</td>
	<td class="tr">{$td[adddate]}</td>
	</tr>
	<tr>
	<td class="tl">Last updated</td>
	<td class="tr">{$td[updatedate]}</td>
	</tr>
	{if $td[send_time]}
	<tr>
	<td class="tl">Delivery time</td>
	<td class="tr">{$td[send_time]}</td>
	</tr>
	{/if}
	<tr>
	<td class="tl">Order Status</td>
	<td class="tr">{$_status[$td[status]]}</td>
	</tr>
	{if $td[buyer_reason]}
	<tr>
	<td class="tl">Refund reason</td>
	<td class="tr">{$td[buyer_reason]}</td>
	</tr>
	{/if}
	<tr>
	<td class="tl"> </td>
	<td class="tr"><input type="button" value=" Back " class="btn" onclick="history.back(-1);"/>
	</td>
	</tr>
	</table>
	</form>
	<script type="text/javascript">s('trade');m('{$nav}');</script>
	{elseif $step == 'pay'}
	<form method="post" action="trade.php" onsubmit="return check();" id="dform">
	<input type="hidden" name="forward" value="{$forward}"/>
	<input type="hidden" name="action" value="{$action}"/>
	<input type="hidden" name="step" value="{$step}"/>
	<input type="hidden" name="itemid" value="{$itemid}"/>
	<table cellspacing="1" cellpadding="8" class="tb">
	<tr>
	<td class="tl">Current Operation</td>
	<td class="tr f_red f_b">Order Payment</td>
	</tr>
	<tr>
	<td class="tl">Order a single number</td>
	<td class="tr">T{$td[itemid]} {if $DT[trade]}({$DT[trade_nm]}Order a single number:{$td[trade_no]}){/if}</td>
	</tr>
	<tr>
	<td class="tl">Product Name</td>
	<td class="tr"><a href="{$td[linkurl]}" target="_blank" class="t">{$td[title]}</a></td>
	</tr>
	<tr>
	<td class="tl">Product Image</td>
	<td class="tr"><a href="{$td[linkurl]}" target="_blank"><img src="{if $td[thumb]}{$td[thumb]}{else}{DT_SKIN}image/nopic60.gif{/if}" width="60" height="60"/></a></td>
	</tr>
	<tr>
	<td class="tl">Seller</td>
	<td class="tr">{if $DT[im_web]}{im_web($td[seller])}&nbsp;{/if}<a href="{userurl($td[seller], 'file=contact')}" target="_blank" class="t">{$td[seller]}</a></td>
	</tr>
	<tr>
	<td class="tl">Next single time</td>
	<td class="tr">{$td[adddate]}</td>
	</tr>
	<tr>
	<td class="tl">Expectations Logistics</td>
	<td class="tr">{$td[buyer_receive]}</td>
	</tr>
	<tr>
	<td class="tl">My Remarks</td>
	<td class="tr">{$td[note]}</td>
	</tr>
	<tr>
	<td class="tl">Commodity price</td>
	<td class="tr">￥{$td[price]}</td>
	</tr>
	<tr>
	<td class="tl">Quantity</td>
	<td class="tr">{$td[number]}</td>
	</tr>
	{if $td[fee]>0.1}
	<tr>
	<td class="tl">{$td[fee_name]}</td>
	<td class="tr">￥{$td[fee]}</td>
	</tr>
	{/if}
	<tr>
	<td class="tl">The amount actually paid</td>
	<td class="tr f_red">￥{$money}</td>
	</tr>
	<tr>
	<td class="tl">Account Balance</td>
	<td class="tr f_blue">￥{$_money}</td>
	</tr>
	<tr>
	<td class="tl"><span class="f_red">*</span> Payment password</td>
	<td class="tr">{template 'password', 'chip'}&nbsp;<span id="dpassword" class="f_red"></span></td>
	</tr>
	{if $_userid && $DT[sms]}
	<tr>
	<td class="tl"></td>
	<td class="tr"><input type="checkbox" name="sendsms" value="1"/> SMS notification seller shipped (<a href="sms.php" target="_blank" class="t">I am available for SMS <strong class="f_blue">{$_sms}</strong> Article</a>)</td>
	</tr>
	{/if}
	<tr>
	<td class="tl"> </td>
	<td class="tr">
	<input type="submit" name="submit" value=" Determined " class="btn"/>&nbsp;&nbsp;<input type="button" value=" Back " class="btn" onclick="history.back(-1);"/>
	</td>
	</tr>
	</table>
	</form>
	<script type="text/javascript">
	function check() {
		if(Dd('password').value == '') {
			Dmsg('Please fill out the payment password', 'password');
			return false;
		}
		return confirm('You confirm this order and immediately pay it?');
	}
	</script>
	<script type="text/javascript">s('trade');m('action_order');</script>
	{elseif $step == 'send_goods'}
	<form method="post" action="trade.php" onsubmit="return check();" id="dform">
	<input type="hidden" name="forward" value="{$forward}"/>
	<input type="hidden" name="action" value="{$action}"/>
	<input type="hidden" name="step" value="{$step}"/>
	<input type="hidden" name="itemid" value="{$itemid}"/>
	<table cellspacing="1" cellpadding="6" class="tb">
	<tr>
	<td class="tl">Current Operation</td>
	<td class="tr f_red f_b">Confirm delivery</td>
	</tr>
	{if $td[buyer_receive]}
	<tr>
	<td class="tl">Buyers expect Logistics</td>
	<td class="tr f_red f_b">{$td[buyer_receive]}</td>
	</tr>
	{/if}
	<tr>
	<td class="tl">Logistics Type</td>
	<td class="tr f_gray"><input type="text" size="10" name="send_type" id="send_type"/>
	<select onchange="Dd('send_type').value=this.value;">
	<option value="">Common types of logistics</option>
	{loop $send_types $v}
	<option value="{$v}">{$v}</option>
	{/loop}
	</select>
	</td>
	</tr>
	<tr>
	<td class="tl">Common types of logistics</td>
	<td class="tr f_gray"><input type="text" size="30" name="send_no" id="send_no"/></td>
	</tr>
	<tr>
	<td class="tl">Delivery time</td>
	<td class="tr f_gray"><input type="text" size="20" name="send_time" id="send_time" value="{$send_time}"/></td>
	</tr>
	{if $_userid && $DT[sms]}
	<tr>
	<td class="tl"></td>
	<td class="tr"><input type="checkbox" name="sendsms" value="1"/> SMS notify the buyer has been shipped (<a href="sms.php" target="_blank" class="t">I am available for SMS <strong class="f_blue">{$_sms}</strong> Article</a>)</td>
	</tr>
	{/if}
	<tr>
	<td class="tl"> </td>
	<td class="tr">
	<input type="submit" name="submit" value=" Determined " class="btn"/>&nbsp;&nbsp;<input type="button" value=" Back " class="btn" onclick="history.back(-1);"/>
	</td>
	</tr>
	</table>
	</form>
	<script type="text/javascript">
	function check() {
		return confirm('You confirm that the goods have been issued, and the above information is complete and correct it? \ n \ n This operation will irrevocably');
	}
	</script>
	<script type="text/javascript">s('trade');m('action');</script>
	{elseif $step == 'add_time'}
	<form method="post" action="trade.php" onsubmit="return check();" id="dform">
	<input type="hidden" name="forward" value="{$forward}"/>
	<input type="hidden" name="action" value="{$action}"/>
	<input type="hidden" name="step" value="{$step}"/>
	<input type="hidden" name="itemid" value="{$itemid}"/>
	<table cellspacing="1" cellpadding="6" class="tb">
	<tr>
	<td class="tl">Current Operation</td>
	<td class="tr f_red f_b">Buyers confirm the time extension</td>
	</tr>
	<tr>
	<td class="tl"><span class="f_red">*</span>Extension of time</td>
	<td class="tr f_gray"><input type="text" size="10" name="add_time" id="add_time" value="{$td[add_time]}"/> Units: hour 1 day = 24 hours integers only&nbsp;<span id="dadd_time" class="f_red"></span></td>
	</tr>
	<tr>
	<td class="tl"> </td>
	<td class="tr">
	<input type="submit" name="submit" value=" Determined " class="btn"/>&nbsp;&nbsp;<input type="button" value=" Back " class="btn" onclick="history.back(-1);"/>
	</td>
	</tr>
	</table>
	</form>
	<script type="text/javascript">
	function check() {
		return confirm('You acknowledge extended'+Dd('add_time').value+'Hours do？');
	}
	</script>
	<script type="text/javascript">s('trade');m('action');</script>
	{elseif $step == 'refund'}
	<form method="post" action="trade.php" onsubmit="return check();" id="dform">
	<input type="hidden" name="forward" value="{$forward}"/>
	<input type="hidden" name="action" value="{$action}"/>
	<input type="hidden" name="step" value="{$step}"/>
	<input type="hidden" name="itemid" value="{$itemid}"/>
	<table cellspacing="1" cellpadding="6" class="tb">
	<tr>
	<td class="tl">Current Operation</td>
	<td class="tr f_red f_b">Apply for a refund</td>
	</tr>
	<tr>
	<td class="tl">Order a single number</td>
	<td class="tr">T{$td[itemid]} {if $DT[trade]}({$DT[trade_nm]}Order a single number:{$td[trade_no]}){/if}</td>
	</tr>
	<tr>
	<td class="tl">Product Name</td>
	<td class="tr"><a href="{$td[linkurl]}" target="_blank" class="t">{$td[title]}</a></td>
	</tr>
	<tr>
	<td class="tl">Product Image</td>
	<td class="tr"><a href="{$td[linkurl]}" target="_blank"><img src="{if $td[thumb]}{$td[thumb]}{else}{DT_SKIN}image/nopic60.gif{/if}" width="60" height="60"/></a></td>
	</tr>
	<tr>
	<td class="tl">Seller</td>
	<td class="tr">{if $DT[im_web]}{im_web($td[seller])}&nbsp;{/if}<a href="{userurl($td[seller], 'file=contact')}" target="_blank" class="t">{$td[seller]}</a></td>
	</tr>
	<tr>
	<td class="tl">Next single time</td>
	<td class="tr">{$td[adddate]}</td>
	</tr>
	<tr>
	<td class="tl">Delivery time</td>
	<td class="tr">{$td[updatedate]}</td>
	</tr>
	<tr>
	<td class="tl">Remarks</td>
	<td class="tr">{$td[note]}</td>
	</tr>
	<tr>
	<td class="tl">Commodity price</td>
	<td class="tr">￥{$td[price]}</td>
	</tr>
	<tr>
	<td class="tl">Quantity</td>
	<td class="tr">{$td[number]}</td>
	</tr>
	{if $td[fee_name] && $td[fee]}
	<tr>
	<td class="tl">{$td[fee_name]}</td>
	<td class="tr">￥{$td[fee]}</td>
	</tr>
	{/if}
	<tr>
	<td class="tl">Order Total</td>
	<td class="tr f_red">￥{$money}</td>
	</tr>
	<tr>
	<td class="tl"><span class="f_red">*</span> Reasons and evidence</td>
	<td class="tr"><textarea name="content" id="content" class="dsn"></textarea>
	{deditor($moduleid, 'content', 'Simple', '98%', 200)}<span id="dcontent" class="f_red"></span></td>
	</tr>
	<tr>
	<td class="tl"><span class="f_red">*</span> Payment password</td>
	<td class="tr">{template 'password', 'chip'}&nbsp;<span id="dpassword" class="f_red"></span></td>
	</tr>
	<tr>
	<td class="tl"> </td>
	<td class="tr">
	<input type="submit" name="submit" value=" Determined " class="btn"/>&nbsp;&nbsp;<input type="button" value=" Back " class="btn" onclick="history.back(-1);"/>
	</td>
	</tr>
	</table>
	</form>
	<script type="text/javascript">
	function check() {
		var len = FCKLen();
		if(len < 10) {
			Dmsg('Reasons and evidence can not be less than 10 characters, the current has been entered '+len+' characters', 'content');
			return false;
		}
		if(Dd('password').value == '') {
			Dmsg('Please fill out the payment password', 'password');
			return false;
		}
		return confirm('You acknowledge that you provide reasons and evidence is correct, and you apply for a refund？');
	}
	</script>
	<script type="text/javascript">s('trade');m('action_order');</script>
	{elseif $step == 'comment'}
	<form method="post" action="trade.php" onsubmit="return check();" id="dform">
	<input type="hidden" name="forward" value="{$forward}"/>
	<input type="hidden" name="action" value="{$action}"/>
	<input type="hidden" name="step" value="{$step}"/>
	<input type="hidden" name="itemid" value="{$itemid}"/>
	<table cellspacing="1" cellpadding="6" class="tb">
	<tr>
	<td class="tl">Current Operation</td>
	<td class="tr f_red f_b">Transaction Rating</td>
	</tr>
	<tr>
	<td class="tl">Transaction Rate</td>
	<td class="tr">
	<input type="radio" name="star" value="3" id="star_3" checked/><label for="star_3"> Favorable comment <img src="{DT_STATIC}file/image/star3.gif" width="36" height="12" alt="" align="absmiddle"/></label>
	<input type="radio" name="star" value="2" id="star_2"/><label for="star_2"> Average <img src="{DT_STATIC}file/image/star2.gif" width="36" height="12" alt="" align="absmiddle"/></label>
	<input type="radio" name="star" value="1" id="star_1"/><label for="star_1"> Poor <img src="{DT_STATIC}file/image/star1.gif" width="36" height="12" alt="" align="absmiddle"/></label>	
	</td>
	</tr>
	<tr>
	<td class="tl">Detailed comments</td>
	<td class="tr f_gray">
	<textarea onkeyup="S();" name="content" id="content" style="width:300px;height:60px;margin:0 0 6px 0;"></textarea><br/>
	On this transaction you make objective and fair comment<br/>
	(Content limit of 0-500 characters) Has entered <span style="color:red;" id="chars">0</span> Word
	</td>
	</tr>
	<tr>
	<td class="tl"> </td>
	<td class="tr">
	<input type="submit" name="submit" value=" Determined " class="btn"/>&nbsp;&nbsp;<input type="button" value=" Back " class="btn" onclick="history.back(-1);"/>
	</td>
	</tr>
	</table>
	</form>
	<script type="text/javascript">
	function check() {
		if(Dd('content').value.length > 500) {
			alert('Review content should not exceed 500 words');
			return false;
		}
		return confirm('You acknowledge submitting this comment? Scores of comments submitted and the content will not be changed');
	}
	function S() {
		Inner('chars', Dd('content').value.length);
	}
	</script>
	<script type="text/javascript">s('trade');m('{$nav}');</script>
	{elseif $step == 'comment_detail'}
	<table cellspacing="1" cellpadding="8" class="tb">
	<tr>
	<td class="tl">Current Operation</td>
	<td class="tr f_red f_b">Rating Details</td>
	</tr>
	</table>
	<div class="t2">Buyers evaluation{if $_username==$td[buyer]}(My){/if}</div>
	<table cellspacing="1" cellpadding="8" class="tb">
	{if $cm[seller_star]}
	<tr>
	<td class="tl">Buyer ratings</td>
	<td class="tr"><img src="{DT_STATIC}file/image/star{$cm[seller_star]}.gif" width="36" height="12" alt="" align="absmiddle"/> {$STARS[$cm[seller_star]]}
	{if $_username == $td[seller] && !$cm[buyer_reply]}
	&nbsp;&nbsp;<a href="#exp" onclick="Ds('explain');" class="t">[Explanation]</a>
	{/if}
	</td>
	</tr>
	<tr>
	<td class="tl">Ratings & Reviews</td>
	<td class="tr">{nl2br($cm[seller_comment])}</td>
	</tr>
	<tr>
	<td class="tl">Comment Time</td>
	<td class="tr px11">{timetodate($cm[seller_ctime], 6)}</td>
	</tr>
	{if $cm[buyer_reply]}
	<tr>
	<td class="tl">Sellers explained</td>
	<td class="tr" style="color:#D9251D;">{nl2br($cm[buyer_reply])}</td>
	</tr>
	<tr>
	<td class="tl">Interpretation time</td>
	<td class="tr px11">{timetodate($cm[buyer_rtime], 6)}</td>
	</tr>
	{/if}
	{else}
	<tr>
	<td class="tl">Ratings & Reviews</td>
	<td class="tr">Write a review</td>
	</tr>
	{/if}
	</table>
	<div class="t2">Seller Ratings{if $_username==$td[seller]}(My){/if}</div>
	<table cellspacing="1" cellpadding="8" class="tb">
	{if $cm[buyer_star]}
	<tr>
	<td class="tl">Seller Rating</td>
	<td class="tr"><img src="{DT_STATIC}file/image/star{$cm[buyer_star]}.gif" width="36" height="12" alt="" align="absmiddle"/> {$STARS[$cm[buyer_star]]}
	{if $_username == $td[buyer] && !$cm[seller_reply]}
	&nbsp;&nbsp;<a href="#exp" onclick="Ds('explain');" class="t">[Explanation]</a>
	{/if}
	</td>
	</tr>
	<tr>
	<td class="tl">Seller Comments</td>
	<td class="tr">{nl2br($cm[buyer_comment])}</td>
	</tr>
	<tr>
	<td class="tl">Comment Time</td>
	<td class="tr px11">{timetodate($cm[buyer_ctime], 6)}</td>
	</tr>
	{if $cm[seller_reply]}
	<tr>
	<td class="tl">Buyer explained</td>
	<td class="tr" style="color:#D9251D;">{nl2br($cm[seller_reply])}</td>
	</tr>
	<tr>
	<td class="tl">Interpretation time</td>
	<td class="tr px11">{timetodate($cm[seller_rtime], 6)}</td>
	</tr>
	{/if}
	{else}
	<tr>
	<td class="tl">Seller Comments</td>
	<td class="tr">Write a review</td>
	</tr>
	{/if}
	</table>
	<div style="display:none;" id="explain">
	<div class="t2">My explanation</div>
	<form method="post" action="trade.php" onsubmit="return check();" id="dform">
	<input type="hidden" name="forward" value="{$forward}"/>
	<input type="hidden" name="action" value="{$action}"/>
	<input type="hidden" name="step" value="{$step}"/>
	<input type="hidden" name="itemid" value="{$itemid}"/>
	<table cellspacing="1" cellpadding="8" class="tb">
	<tr>
	<td class="tl"><span class="f_red">*</span>My explanation</td>
	<td class="tr f_gray">
	<textarea onkeyup="S();" name="content" id="content" style="width:300px;height:60px;margin:0 0 6px 0;"></textarea><br/>
	Please make this evaluation on objective and reasonable explanation<br/>
	(Content limit of 2-500 characters) Has entered <span style="color:red;" id="chars">0</span> Word
	</td>
	</tr>
	<tr>
	<td class="tl"> </td>
	<td class="tr">
	<input type="submit" name="submit" value=" Determined " class="btn"/>&nbsp;&nbsp;<input type="button" value=" Back " class="btn" onclick="history.back(-1);"/>
	</td>
	</tr>
	</table>
	</form>
	</div>
	<a name="exp"></a>
	<script type="text/javascript">
	function check() {
		if(Dd('content').value.length < 2) {
			alert('Content of not less than two words explain');
			return false;
		}
		if(Dd('content').value.length > 500) {
			alert('Content is not more than 500 words explaining');
			return false;
		}
		return confirm('You confirm that you submit this explanation? After the submission of the content will not be changed interpretation');
	}
	function S() {
		Inner('chars', Dd('content').value.length);
	}
	</script>
	<script type="text/javascript">s('trade');m('{$nav}');</script>
	{/if}
{elseif $action == 'order'}
<!--[I sent the order, I am a buyer]-->
<div class="tt">
<form action="trade.php">
<input type="hidden" name="action" value="{$action}"/>
{$fields_select}&nbsp;
<input type="text" size="10" name="kw" value="{$kw}" title="Keyword"/>&nbsp;
{$status_select}&nbsp;
{dcalendar('fromtime', $fromtime)} To {dcalendar('totime', $totime)}&nbsp;
<input type="submit" value=" Search " class="btn"/>&nbsp;
<input type="button" value=" Reset " class="btn" onclick="Go('trade.php?action={$action}');"/><br/>
<div class="b10"></div>
Odd number：<input type="text" size="10" name="itemid" value="{$itemid}"/>&nbsp;
CommodityID：<input type="text" size="10" name="mallid" value="{$mallid}"/>&nbsp;
Seller：<input type="text" size="20" name="seller" value="{$seller}"/>&nbsp;
</div>
</form>
<div class="bd">
<table cellpadding="1" cellspacing="0" class="tb">
<tr>
<th width="60">Thumbnails</th>
<th>The goods or services</th>
<th width="60">Money</th>
<th width="80">Seller</th>
<th width="{if $DT[im_web]}40{else}16{/if}">&nbsp;</th>
<th width="75">Next single time</th>
<th width="75">Next single time</th>
<th width="90">Status</th>
</tr>
{loop $trades $k $v}
<tr align="center"{if $k%2==1} bgcolor="#FAFAFA"{/if}>
<td rowspan="2" height="70"><a href="{$v[linkurl]}" target="_blank"><img src="{if $v[thumb]}{$v[thumb]}{else}{DT_SKIN}image/nopic50.gif{/if}" width="50" height="50" onerror="this.src=errimg;"/></a></td>
<td align="left" style="padding:0 8px 0 8px;" class="f_b f_dblue"><a href="{$v[linkurl]}" target="_blank" class="t">{$v[title]}</a></td>
<td class="f_price" title="Commodity price：￥{$v[price]} x {$v[number]}件 = {$v[amount]}{if $v[fee]>0.1} {$v[fee_name]}:{$v[fee]}{/if}">{$v[money]}</td>
<td class="px11"><a href="{userurl($v[seller], 'file=contact')}" target="_blank">{$v[seller]}</a></td>
<td>{if $DT[im_web]}{im_web($v[seller].'&mid=16&itemid='.$v[mallid])} {/if}<a href="message.php?action=send&touser={$v[seller]}" target="_blank"><img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/ico_message.gif" title="Send message" align="absmiddle"/></a></td>
<td class="px11">{$v[addtime]}</td>
<td class="px11">{$v[updatetime]}</td>
<td>{$v[dstatus]}</td>
</tr>
<tr{if $k%2==1} bgcolor="#FAFAFA"{/if}>
<td colspan="8" class="f_gray">
<span class="f_r">
{if $v[status] == 0}
<input type="button" value="Delete" class="btn" onclick="if(confirm('You sure you want to delete this deal? This action shall be irrevocable')) Go('trade.php?itemid={$v[itemid]}&action=update&step=close&forward={$forward}');"/>
{elseif $v[status] == 1}
	{if $DT[trade]}
	<a href="trade.php?itemid={$v[itemid]}&action=update&step=pay&forward={$forward}" class="t" onclick="return confirm('Confirm the order is correct, you pay now?');" target="_blank"><img src="{DT_PATH}api/trade/{$DT[trade]}/pay.gif" align="absmiddle" title="{$DT[trade_nm]}Payment"/></a>
	{else}
	<input type="button" value="Payment" class="btn" onclick="Go('trade.php?itemid={$v[itemid]}&action=update&step=pay&forward={$forward}');"/>
	{/if}
<input type="button" value="Close the transaction" class="btn" onclick="if(confirm('Really want to close this deal? This action shall be irrevocable')) Go('trade.php?itemid={$v[itemid]}&action=update&step=close&forward={$forward}');"/>
{elseif $v[status] == 3}

	{if $v[lefttime]}
	<span class="f_blue" title="If untreated overdue, the system will automatically payment to the seller"><img src="{DT_STATIC}file/image/clock.gif" width="12" height="12"/> Processing this order from left{$v[lefttime]}</span>&nbsp;
	<input type="button" value="Confirm arrival" class="btn" onclick="if(confirm('Acknowledge receipt of the goods and the quality and quantity of correct it?\n\nNote: Make sure to post your money will be paid directly to the seller')) Go('trade.php?itemid={$v[itemid]}&action=update&step=receive_goods&forward={$forward}');"/>
	<input type="button" value="Apply for a refund" class="btn" onclick="Go('trade.php?itemid={$v[itemid]}&action=update&step=refund&forward={$forward}');"/>
	{else}
	<span class="f_red">Order processing has timed out, wait to sell receivables</span>&nbsp;
	{/if}
{elseif $v[status] == 4}
	{if $v[seller_star]}
	<input type="button" value="Rating Details" class="btn" onclick="Go('trade.php?itemid={$v[itemid]}&action=update&step=comment_detail&forward={$forward}');"/>
	{else}
	<input type="button" value="Evaluation" class="btn" onclick="Go('trade.php?itemid={$v[itemid]}&action=update&step=comment&forward={$forward}');"/>
	{/if}
{elseif $v[status] == 9}
<input type="button" value="Deleted" class="btn" onclick="Go('trade.php?itemid={$v[itemid]}&action=update&step=close&forward={$forward}');"/>
{/if}
<input type="button" value="Order details" class="btn" onclick="Go('trade.php?itemid={$v[itemid]}&action=update&step=detail');"/>
&nbsp;
</span>
&nbsp;
<strong>Odd number：</strong>{$v[itemid]}&nbsp;&nbsp;
<strong>Unit price：</strong>￥{$v[price]}&nbsp;&nbsp;
<strong>Quantity：</strong>{$v[number]}件&nbsp;&nbsp;
<strong>Remark：</strong>{$v[note]}
</td>
</tr>
{/loop}
{if $trades}
<tr align="center">
<td height="30">&nbsp;</td>
<td><strong>Subtotal</strong></td>
<td class="f_red f_b px11">{$money}</td>
<td colspan="5" align="left" class="f_red">&nbsp;&nbsp;Tip: If you have any questions about the transaction, please contact the Web site</td>
</tr>
{/if}
</table>
</div>
<div class="pages">{$pages}</div>
<script type="text/javascript">s('trade');m('action_order');</script>
{else}
<!--[I received the order, I was the seller]-->
{if $MG[trade_sell]}
<div class="tt">
<form action="trade.php">
<input type="hidden" name="action" value="{$action}"/>
{$fields_select}&nbsp;
<input type="text" size="10" name="kw" value="{$kw}" title="Keyword"/>&nbsp;
{$status_select}&nbsp;
{dcalendar('fromtime', $fromtime)} To {dcalendar('totime', $totime)}&nbsp;
<input type="submit" value=" Search " class="btn"/>&nbsp;
<input type="button" value=" Reset " class="btn" onclick="Go('trade.php?action={$action}');"/><br/>
<div class="b10"></div>
Odd number：<input type="text" size="10" name="itemid" value="{$itemid}"/>&nbsp;
CommodityID：<input type="text" size="10" name="mallid" value="{$mallid}"/>&nbsp;
Buyers：<input type="text" size="20" name="buyer" value="{$buyer}"/>&nbsp;
</form>
</div>
<div class="bd">
<table cellpadding="1" cellspacing="0" class="tb">
<tr>
<th width="60">Thumbnails</th>
<th>The goods or services</th>
<th width="60">Money</th>
<th width="80">Buyers</th>
<th width="{if $DT[im_web]}40{else}16{/if}">&nbsp;</th>
<th width="75">Next single time</th>
<th width="75">Updated</th>
<th width="90">Status</th>
</tr>
{loop $trades $k $v}
<tr align="center"{if $k%2==1} bgcolor="#FAFAFA"{/if}>
<td rowspan="2" height="70"><a href="{$v[linkurl]}" target="_blank"><img src="{if $v[thumb]}{$v[thumb]}{else}{DT_SKIN}image/nopic50.gif{/if}" width="50" height="50" onerror="this.src=errimg;"/></a></td>
<td align="left" style="padding:0 8px 0 8px;" class="f_b f_dblue"><a href="{$v[linkurl]}" target="_blank" class="t">{$v[title]}</a>{if $v[status] == 0} <img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/new.gif"/>{/if}</td>
<td class="f_blue f_b px11" title="Commodity price：￥{$v[price]} x {$v[number]}Item = {$v[amount]}{if $v[fee]>0.1} {$v[fee_name]}:{$v[fee]}{/if}">{$v[money]}</td>
<td class="px11"><a href="{userurl($v[buyer], 'file=contact')}" target="_blank">{$v[buyer]}</a></td>
<td>{if $DT[im_web]}{im_web($v[buyer].'&mid=16&itemid='.$v[mallid])} {/if}<a href="message.php?action=send&touser={$v[buyer]}" target="_blank"><img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/ico_message.gif" title="Send message" align="absmiddle"/></a></td>
<td class="px11">{$v[addtime]}</td>
<td class="px11">{$v[updatetime]}</td>
<td>{$v[dstatus]}</td>
</tr>
<tr{if $k%2==1} bgcolor="#FAFAFA"{/if}>
<td colspan="8" class="f_gray">
<span class="f_r">
{if $v[status] == 0}
<input type="button" value="Confirm Order" class="btn" onclick="if(confirm('You really want to confirm this order? This action shall be irrevocable')) Go('trade.php?itemid={$v[itemid]}&action=update&step=confirm_order&forward={$forward}');"/>
<input type="button" value="Modify the price" class="btn" onclick="Go('trade.php?itemid={$v[itemid]}&action=update&step=edit_price');"/>
<input type="button" value="Close the transaction" class="btn" onclick="if(confirm('Really want to close this deal? This action shall be irrevocable')) Go('trade.php?itemid={$v[itemid]}&action=update&step=close&forward={$forward}');"/>
{elseif $v[status] == 1}
<input type="button" value="Modify the price" class="btn" onclick="Go('trade.php?itemid={$v[itemid]}&action=update&step=edit_price');"/>
<input type="button" value="Close the transaction" class="btn" onclick="if(confirm('Really want to close this deal? This action shall be irrevocable')) Go('trade.php?itemid={$v[itemid]}&action=update&step=close&forward={$forward}');"/>
{elseif $v[status] == 2}
<input type="button" value="Confirm delivery" class="btn" onclick="Go('trade.php?itemid={$v[itemid]}&action=update&step=send_goods');"/>
{if !$DT[trade]}<input type="button" value="Close the transaction" class="btn" onclick="if(confirm('Really want to close this deal? This action shall be irrevocable')) Go('trade.php?itemid={$v[itemid]}&action=update&step=close&forward={$forward}');"/>{/if}
{elseif $v[status] == 3}
	{if $v[lefttime]}
	<span class="f_blue"><img src="{DT_STATIC}file/image/clock.gif" width="12" height="12"/> Processing orders from buyers left{$v[lefttime]}</span>&nbsp;
	<input type="button" value="Extension of time" class="btn" onclick="Go('trade.php?itemid={$v[itemid]}&action=update&step=add_time&forward={$forward}');"/>
	{else}
	<span class="f_blue">Buyers processing orders timeout</span>
	<input type="button" value="Direct collection" class="btn" onclick="Go('trade.php?itemid={$v[itemid]}&action=update&step=get_pay&forward={$forward}');"/>
	{/if}
{elseif $v[status] == 4}
	{if $v[buyer_star]}
	<input type="button" value="Rating Details" class="btn" onclick="Go('trade.php?itemid={$v[itemid]}&action=update&step=comment_detail&forward={$forward}');"/>
	{else}
	<input type="button" value="Evaluation" class="btn" onclick="Go('trade.php?itemid={$v[itemid]}&action=update&step=comment&forward={$forward}');"/>
	{/if}
{elseif $v[status] == 8}
<input type="button" value="Deleted" class="btn" onclick="Go('trade.php?itemid={$v[itemid]}&action=update&step=close&forward={$forward}');"/>
{/if}
<input type="button" value="Order details" class="btn" onclick="Go('trade.php?itemid={$v[itemid]}&action=update&step=detail');"/>
&nbsp;
</span>
&nbsp;
<strong>Odd number：</strong>{$v[itemid]}&nbsp;&nbsp;
<strong>Unit price：</strong>￥{$v[price]}&nbsp;&nbsp;
<strong>Quantity：</strong>{$v[number]}件&nbsp;&nbsp;
<strong>Remark：</strong>{$v[note]}
</td>
</tr>
{/loop}
{if $trades}
<tr align="center">
<td height="30">&nbsp;</td>
<td><strong>Subtotal</strong></td>
<td class="f_blue f_b px11">{$money}</td>
<td colspan="5" align="left" class="f_red">&nbsp;&nbsp;Tip: If you have any questions about the transaction, please contact the Web site</td>
</tr>
{/if}
</table>
</div>
<div class="pages">{$pages}</div>
{else}
<br/><br/><br/><br/><br/>
<center class="px14">Currently received <span class="f_red">{$orders}</span> Orders，Please<a href="grade.php" class="t">Upgrade your membership level </a> to obtain permission to view</center>
{/if}
<script type="text/javascript">s('trade');m('action');</script>
{/if}
{template 'footer', $module}